package com.nbsaas.boot.pms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "项目里程碑", model = "项目里程碑")
@Entity
@Table(name = "bs_pms_milestone")
@Comment("项目里程碑表")
public class Milestone extends AbstractEntity {

    @Comment("里程碑名称")
    @SearchItem(name = "name", key = "name", label = "里程碑名称")
    @FormField(title = "里程碑名称", sortNum = "1", grid = true, required = true)
    @Column(length = 200, nullable = false)
    private String name;

    @Comment("项目ID")
    @FormField(title = "所属项目", sortNum = "2", grid = true, type = InputType.select)
    private Long projectId;

    @Comment("里程碑描述")
    @FormField(title = "里程碑描述", sortNum = "3", type = InputType.textarea, col = 23)
    @Column(columnDefinition = "TEXT")
    private String description;

    @Comment("里程碑状态")
    @FormField(title = "里程碑状态", sortNum = "4", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status; // PLANNED-计划中, IN_PROGRESS-进行中, COMPLETED-已完成, DELAYED-延期

    @Comment("计划完成时间")
    @FormField(title = "计划完成时间", sortNum = "5", type = InputType.date, grid = true)
    private Date plannedDate;

    @Comment("实际完成时间")
    @FormField(title = "实际完成时间", sortNum = "6", type = InputType.date, grid = true)
    private Date actualDate;

    @Comment("里程碑类型")
    @FormField(title = "里程碑类型", sortNum = "7", grid = true, type = InputType.select)
    @Column(length = 20)
    private String type; // RELEASE-发布, REVIEW-评审, DELIVERY-交付, OTHER-其他

    @Comment("优先级")
    @FormField(title = "优先级", sortNum = "8", grid = true, type = InputType.select)
    @Column(length = 20)
    private String priority; // LOW-低, MEDIUM-中, HIGH-高, CRITICAL-关键

    @Comment("备注")
    @FormField(title = "备注", sortNum = "9", type = InputType.textarea, col = 23)
    @Column(columnDefinition = "TEXT")
    private String remarks;
} 